<div class="workerInfo main">
  <div class="query-info shadowbox">
    <div class="container-header">人员信息</div>
    <form class="base-info pa-form-content">
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">档案编号:</label>         
        <input type="text" class="form-control-input"
          ng-model="queryWorkerInfo.userInfo.recordNo"/>         
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">姓&nbsp;名:</label>
        <input type="text" class="form-control-input"
          ng-model="queryWorkerInfo.userInfo.name"/>
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">身份证号:</label>
        <input type="text"
          ng-model="queryWorkerInfo.userInfo.idCard"/>
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">施工队:</label>
        <select id="type" name="type" style="width: 240px;" 
          ng-model="queryWorkerInfo.userInfo.constructionTeamId">
          <option value=""></option>
          <optgroup
            ng-repeat="teamGroup in queryWorkerInfo.teamWithOrgList"
            label="{{teamGroup.orgUnitName}}">
            <option
              ng-repeat="team in teamGroup.teamList"
              value="{{team.teamId}}">
              {{team.teamName}}
            </option>
          </optgroup>
        </select>
      </div>             
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">是否特种人员:</label>
        <select name="isSpecial"
          ng-model="queryWorkerInfo.userInfo.isspecialMan">
          <option value=""></option>
          <option value="1">是</option>
          <option value="0">否</option>
        </select>
      </div>                       
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">进场日期:</label>
        <input type="text"
          ng-datepicker
          ng-model="queryWorkerInfo.userInfo.inTime" />
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">离场日期:</label>
        <input type="text"
          ng-datepicker
          ng-model="queryWorkerInfo.userInfo.leaveTime" />
      </div> 
    </form>
    <div class="btn-outer-right">
      <a class="pa-btn" ng-click="queryWorkerInfo.query()">
        <i class="fa fa-search"></i>
        <span class="ml5">查询</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="queryWorkerInfo.reset();">
        <i class="fa fa-repeat"></i>
        <span class="ml5">重置</span>
      </a>
    </div>
  </div>
  <div class="registration-code">
    <a class="pa-btn"
      authorization-btn="api/safesite/workerInfo/saveRecord"
      ui-sref="workerInfoDetailNew"
      >新增人员</a>
    <a class="pa-btn"
      authorization-btn="api/safesite/workerInfo/leavesite"
      ng-click="queryWorkerInfo.forRegistration()">
      离场登记
    </a>
    <a class="pa-btn"
      ng-click="queryWorkerInfo.printQrCode()">
      打印二维码
    </a>
  </div>
  <div class="pa-table-container shadowbox">
    <form class="base-info">
      <table class="pa-table">
        <thead>
          <tr> 
            <th style="width: 68px;"><input type="checkbox"
              class="form-control-box"
              ng-model="queryWorkerInfo.toggleAllFlag"
              ng-click="queryWorkerInfo.toggleAll()"/>全选</th>
            <th class="time-sequence">
              <div>档案编号</div>
              <div class="time-sequence-btn">
                <div class="time-sequence-box"
                  ng-click="queryWorkerInfo.up('record_no','0')">
                  <i class="fa fa-caret-up"></i>
                </div>
                <div class="time-sequence-box"
                  ng-click="queryWorkerInfo.up('record_no','1')">
                  <i class="fa fa-caret-down"></i>
                </div> 
              </div>
            </th>
            <th>姓名</th>
            <th>身份证号</th>
            <th>岗位类别</th>
            <th class="time-sequence">
              <div>进场日期</div>
              <div class="time-sequence-btn">
                <div class="time-sequence-box"
                  ng-click="queryWorkerInfo.up('intime','0')">
                  <i class="fa fa-caret-up"></i>
                </div>
                <div class="time-sequence-box"
                  ng-click="queryWorkerInfo.up('intime','1')">
                  <i class="fa fa-caret-down"></i>
                </div> 
              </div>                  
            </th>
            <th class="time-sequence">
              <div>离场日期</div>
              <div class="time-sequence-btn">
                <div class="time-sequence-box"
                  ng-click="queryWorkerInfo.up('leavetime','0')">
                  <i class="fa fa-caret-up"></i>
                </div>
                <div class="time-sequence-box"
                  ng-click="queryWorkerInfo.up('leavetime','1')">
                  <i class="fa fa-caret-down"></i>
                </div> 
              </div>
            </th>
            <th>所在单位</th>
            <th>施工队</th>
            <th>特种人员</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat ="item in queryWorkerInfo.workerItemList">
            <td>
              <input type="checkbox"
                class="form-control-box"  
                ng-model="item.checked"
                ng-change="queryWorkerInfo.isChange()"/>
            </td>
            <td>{{item.recordNo}}</td>
            <td>{{item.name}}</td>
            <td>{{item.idCard}}</td>
            <td>{{item.stationCategoryText}}</td>
            <td>{{item.inTime1}}</td>
            <td>{{item.leaveTime1}}</td>
            <td>{{item.orgName}}</td>
            <td>{{item.constructionTeamName}}</td>
            <td>{{item.isspecialMan == '0' ? '否' :
              item.isspecialMan == '1' ? '是' : ''}}</td>
            <td>
              <div class="del"
                authorization-btn="api/safesite/workerInfo/selectByPrimaryKey"
                ng-click="$state.go('workerInfoDetail',{id: item.id})">
                <i class="fa fa-street-view color"></i>
                <span class="pointer">查看</span>
              </div>
              <div class="del"
                authorization-btn="api/safesite/workerInfo/delete"
                ng-click="queryWorkerInfo.delete(item.id)">
                <i class="fa fa-trash color"></i>
                <span class="pointer">删除</span>
              </div>                  
            </td>
         </tr>            
        </tbody>
      </table>
      <div class="total-num">
        共计<span class="total-num-colorful">{{queryWorkerInfo.paginationData.total}}</span>条
      </div>
      <!-- 分页 -->
      <div class="pagination-outer pagination-sm">
        <uib-pagination
          total-items="queryWorkerInfo.paginationData.total"
          ng-model="queryWorkerInfo.paginationData.pageNum"
          items-per-page="queryWorkerInfo.paginationData.pageSize"
          ng-change="pageChange()"
          class="pagination-sm"
          boundary-link-numbers="true"
          max-size="5"
          next-text="下一页"
          previous-text="上一页"></uib-pagination>
      </div>
    </form>
  </div>
</div>

<script type="text/ng-template" id="workerExitDialog">
  <div class="item-detail-dialog">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>人员出场</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <div class="row-item">
        <div class="fixed-left-label">出场时间：</div>
        <div style="display: inline-block;line-height: 28px;">
          <input type="text" autofocus="true" style="width:0;height:0;padding:0;" />
          <input type="text" name="leaveTime" ng-datepicker
            ng-model="vm.outPlantTime"/>
        </div>
      </div>           
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn" ng-click="vm.submit()">
        <i class="fa fa-save"></i>
        <span class="ml5">确定</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span class="ml5">取消</span>
      </a>
    </div>
  </div>
</script>

<script type="text/ng-template" id="workerInfoQrCodePrintDialog">
  <div class="item-detail-dialog">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>人员信息二维码</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <div class="qr-print-scroll-outer">
        <div class="qr-print" style="width: 300px;">
          <div class="qr-item" style="width: 300px;height: 225px; overflow: hidden; word-wrap: break-word;"
            ng-repeat="item in selectedWorkerList">
            <table class="qr-info" style="width: 100%; height: 100%;">
              <tr>
                <td class="qr-info" style="font-size: 22px;font-weight: 600;text-align: right;">
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.name}}
                  </div>
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.constructionTeamName}}
                  </div>
                  <div style="width: 120px;word-wrap: break-word;padding-right: 6px;">
                    {{::item.stationCategoryText}}
                  </div>
                </td>
                <td class="qr-img" style="text-align: center; width: 160px; ">
                  <img style="width:160px; height: 160px; " ng-src="{{vm.getQrCodeSrc(item)}}">
                  <!-- <img style="width:100%;" src="../../../assets/images/apk.png"> -->
                </td>
              </tr>
            </table>
          </div>
        </div>
      </div>
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn" ng-click="vm.print()">
        <i class="fa fa-save"></i>
        <span class="ml5">打印</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span class="ml5">取消</span>
      </a>
    </div>
  </div>
</script>